home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10587 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  2.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 6c 61 6e 67 2e 63 2b | 2b 0a 50 61 74 68 3a 20 |.lang.c+|+.Path: |
|00000020| 6e 65 77 73 2e 65 6e 67 | 2e 63 6f 6e 76 65 78 2e |news.eng|.convex.|
|00000030| 63 6f 6d 21 61 72 63 6f | 21 75 73 65 6e 65 74 0a |com!arco|!usenet.|
|00000040| 46 72 6f 6d 3a 20 42 72 | 69 61 6e 20 4c 65 61 63 |From: Br|ian Leac|
|00000050| 68 20 3c 6c 61 73 62 66 | 6c 3e 0a 53 75 62 6a 65 |h <lasbf|l>.Subje|
|00000060| 63 74 3a 20 52 65 3a 20 | 68 6f 77 20 74 6f 20 64 |ct: Re: |how to d|
|00000070| 65 6c 65 74 65 20 64 61 | 74 61 20 69 6e 20 66 69 |elete da|ta in fi|
|00000080| 6c 65 3f 20 68 65 6c 70 | 0a 58 2d 4e 6e 74 70 2d |le? help|.X-Nntp-|
|00000090| 50 6f 73 74 69 6e 67 2d | 48 6f 73 74 3a 20 31 33 |Posting-|Host: 13|
|000000a0| 36 2e 32 32 36 2e 31 31 | 36 2e 31 0a 43 6f 6e 74 |6.226.11|6.1.Cont|
|000000b0| 65 6e 74 2d 54 79 70 65 | 3a 20 74 65 78 74 2f 70 |ent-Type|: text/p|
|000000c0| 6c 61 69 6e 3b 20 63 68 | 61 72 73 65 74 3d 75 73 |lain; ch|arset=us|
|000000d0| 2d 61 73 63 69 69 0a 4d | 65 73 73 61 67 65 2d 49 |-ascii.M|essage-I|
|000000e0| 44 3a 20 3c 44 6e 79 6f | 70 4c 2e 34 44 4b 40 6e |D: <Dnyo|pL.4DK@n|
|000000f0| 65 77 73 2e 61 72 63 6f | 2e 63 6f 6d 3e 0a 54 6f |ews.arco|.com>.To|
|00000100| 3a 20 6d 69 6b 68 61 69 | 6c 40 73 69 6e 67 6e 65 |: mikhai|l@singne|
|00000110| 74 2e 63 6f 6d 2e 73 67 | 0a 53 65 6e 64 65 72 3a |t.com.sg|.Sender:|
|00000120| 20 75 73 65 6e 65 74 40 | 6e 65 77 73 2e 61 72 63 | usenet@|news.arc|
|00000130| 6f 2e 63 6f 6d 0a 43 6f | 6e 74 65 6e 74 2d 54 72 |o.com.Co|ntent-Tr|
|00000140| 61 6e 73 66 65 72 2d 45 | 6e 63 6f 64 69 6e 67 3a |ansfer-E|ncoding:|
|00000150| 20 37 62 69 74 0a 4f 72 | 67 61 6e 69 7a 61 74 69 | 7bit.Or|ganizati|
|00000160| 6f 6e 3a 20 41 52 43 4f | 20 4f 69 6c 20 25 20 47 |on: ARCO| Oil % G|
|00000170| 61 73 20 43 6f 6d 70 61 | 6e 79 0a 52 65 66 65 72 |as Compa|ny.Refer|
|00000180| 65 6e 63 65 73 3a 20 3c | 34 68 65 6c 70 6b 24 35 |ences: <|4helpk$5|
|00000190| 30 63 40 6c 61 6e 74 61 | 6e 61 2e 73 69 6e 67 6e |0c@lanta|na.singn|
|000001a0| 65 74 2e 63 6f 6d 2e 73 | 67 3e 0a 4d 69 6d 65 2d |et.com.s|g>.Mime-|
|000001b0| 56 65 72 73 69 6f 6e 3a | 20 31 2e 30 0a 44 61 74 |Version:| 1.0.Dat|
|000001c0| 65 3a 20 46 72 69 2c 20 | 38 20 4d 61 72 20 31 39 |e: Fri, |8 Mar 19|
|000001d0| 39 36 20 31 38 3a 32 39 | 3a 34 35 20 47 4d 54 0a |96 18:29|:45 GMT.|
|000001e0| 58 2d 4d 61 69 6c 65 72 | 3a 20 4d 6f 7a 69 6c 6c |X-Mailer|: Mozill|
|000001f0| 61 20 31 2e 31 32 20 28 | 58 31 31 3b 20 49 3b 20 |a 1.12 (|X11; I; |
|00000200| 48 50 2d 55 58 20 41 2e | 30 39 2e 30 35 20 39 30 |HP-UX A.|09.05 90|
|00000210| 30 30 2f 37 35 35 29 0a | 58 2d 55 72 6c 3a 20 6e |00/755).|X-Url: n|
|00000220| 65 77 73 3a 34 68 65 6c | 70 6b 24 35 30 63 40 6c |ews:4hel|pk$50c@l|
|00000230| 61 6e 74 61 6e 61 2e 73 | 69 6e 67 6e 65 74 2e 63 |antana.s|ingnet.c|
|00000240| 6f 6d 2e 73 67 0a 0a 6d | 69 6b 68 61 69 6c 40 73 |om.sg..m|ikhail@s|
|00000250| 69 6e 67 6e 65 74 2e 63 | 6f 6d 2e 73 67 20 28 4d |ingnet.c|om.sg (M|
|00000260| 69 6b 68 61 69 6c 20 43 | 68 6f 6f 20 57 2e 4d 2e |ikhail C|hoo W.M.|
|00000270| 29 20 77 72 6f 74 65 3a | 0a 3e 48 49 20 74 68 65 |) wrote:|.>HI the|
|00000280| 72 65 2c 0a 3e 20 20 20 | 49 20 6b 6e 6f 77 20 74 |re,.> |I know t|
|00000290| 68 69 73 20 6d 61 79 20 | 73 65 65 6d 20 6c 69 6b |his may |seem lik|
|000002a0| 65 20 61 20 72 65 61 6c | 20 73 74 75 70 69 64 20 |e a real| stupid |
|000002b0| 71 75 65 73 74 69 6f 6e | 2c 20 62 75 74 20 49 20 |question|, but I |
|000002c0| 68 61 64 20 74 6f 20 61 | 73 6b 2e 20 49 66 20 73 |had to a|sk. If s|
|000002d0| 61 79 0a 3e 66 6f 72 20 | 65 78 61 6d 70 6c 65 20 |ay.>for |example |
|000002e0| 49 20 6e 65 65 64 65 64 | 20 74 6f 20 64 65 6c 65 |I needed| to dele|
|000002f0| 74 65 20 61 20 73 74 72 | 69 6e 67 20 6f 66 20 64 |te a str|ing of d|
|00000300| 61 74 61 20 66 6f 72 6d | 20 61 20 66 69 6c 65 2c |ata form| a file,|
|00000310| 20 68 6f 77 20 64 6f 20 | 49 20 67 6f 20 61 62 6f | how do |I go abo|
|00000320| 75 74 0a 3e 64 6f 69 6e | 67 20 69 74 2e 20 49 20 |ut.>doin|g it. I |
|00000330| 63 61 6e 27 74 20 6a 75 | 73 74 20 77 72 69 74 65 |can't ju|st write|
|00000340| 20 6f 76 65 72 20 74 68 | 65 20 64 61 74 61 20 74 | over th|e data t|
|00000350| 6f 20 64 65 6c 65 74 65 | 2c 20 62 65 63 61 75 73 |o delete|, becaus|
|00000360| 65 20 74 68 65 20 72 65 | 73 75 6c 74 20 77 6f 75 |e the re|sult wou|
|00000370| 6c 64 0a 3e 62 65 20 61 | 20 66 69 6c 65 20 6f 66 |ld.>be a| file of|
|00000380| 20 74 68 65 20 73 61 6d | 65 20 6c 65 6e 67 74 68 | the sam|e length|
|00000390| 20 77 69 74 68 20 77 68 | 69 74 65 20 73 70 61 63 | with wh|ite spac|
|000003a0| 65 20 63 68 72 61 63 74 | 65 72 73 2e 20 53 6f 20 |e chract|ers. So |
|000003b0| 68 6f 77 20 64 6f 65 73 | 20 6f 6e 65 20 64 65 6c |how does| one del|
|000003c0| 65 74 65 0a 3e 74 68 65 | 20 64 61 74 61 20 69 6e |ete.>the| data in|
|000003d0| 20 73 75 63 68 20 61 20 | 77 61 79 20 74 68 61 74 | such a |way that|
|000003e0| 20 6f 6e 63 65 20 74 68 | 65 20 64 61 74 61 20 73 | once th|e data s|
|000003f0| 65 67 6d 65 6e 74 20 69 | 73 20 64 65 6c 65 74 65 |egment i|s delete|
|00000400| 64 2c 20 74 68 65 20 72 | 65 73 74 20 6f 66 20 74 |d, the r|est of t|
|00000410| 68 65 0a 3e 64 61 74 61 | 20 77 6f 75 6c 64 20 6e |he.>data| would n|
|00000420| 65 61 74 6c 79 20 70 61 | 63 6b 20 74 68 65 6d 73 |eatly pa|ck thems|
|00000430| 65 6c 76 65 73 20 6f 76 | 65 72 20 74 68 65 20 64 |elves ov|er the d|
|00000440| 65 6c 65 74 65 64 20 61 | 72 65 61 20 74 6f 20 20 |eleted a|rea to |
|00000450| 65 6e 73 75 72 65 20 61 | 20 72 65 6c 65 61 73 65 |ensure a| release|
|00000460| 20 6f 66 0a 3e 73 70 61 | 63 65 2e 20 49 20 6b 6e | of.>spa|ce. I kn|
|00000470| 6f 77 20 6f 6e 65 20 77 | 61 79 20 74 6f 20 73 6f |ow one w|ay to so|
|00000480| 6c 76 65 20 74 68 65 20 | 70 72 6f 62 6c 65 6d 2c |lve the |problem,|
|00000490| 20 62 75 74 20 69 74 20 | 73 65 65 6d 73 20 76 65 | but it |seems ve|
|000004a0| 72 79 20 6c 6f 6e 67 2d | 77 69 6e 64 65 64 2e 20 |ry long-|winded. |
|000004b0| 54 68 65 0a 3e 6d 65 74 | 68 6f 64 20 69 6e 76 6f |The.>met|hod invo|
|000004c0| 6c 76 65 73 20 72 65 61 | 64 69 6e 67 20 61 6c 6c |lves rea|ding all|
|000004d0| 20 74 68 65 20 64 61 74 | 61 20 69 6e 20 74 68 65 | the dat|a in the|
|000004e0| 20 66 69 6c 65 20 74 6f | 20 6d 65 6d 6f 72 79 2c | file to| memory,|
|000004f0| 20 64 65 6c 65 74 65 69 | 6e 67 20 74 68 65 0a 3e | deletei|ng the.>|
|00000500| 75 6e 77 61 6e 74 65 64 | 20 61 72 65 61 2c 20 61 |unwanted| area, a|
|00000510| 6e 64 20 74 68 65 20 72 | 65 2d 77 72 69 74 65 20 |nd the r|e-write |
|00000520| 74 68 65 20 64 61 74 61 | 20 62 61 63 6b 20 74 6f |the data| back to|
|00000530| 20 63 6c 65 61 6e 20 66 | 69 6c 65 2e 20 49 20 61 | clean f|ile. I a|
|00000540| 6d 20 63 75 72 72 65 6e | 74 6c 79 0a 3e 75 73 69 |m curren|tly.>usi|
|00000550| 6e 67 20 42 6f 72 6c 61 | 6e 64 20 43 2b 2b 20 34 |ng Borla|nd C++ 4|
|00000560| 2e 35 2c 20 61 6e 64 20 | 49 20 63 61 6e 27 74 20 |.5, and |I can't |
|00000570| 66 69 6e 64 20 61 6e 79 | 20 66 75 6e 63 74 69 6f |find any| functio|
|00000580| 6e 20 74 68 61 74 20 64 | 6f 65 73 20 74 68 65 20 |n that d|oes the |
|00000590| 6a 6f 62 2e 20 4f 4b 20 | 4f 4b 2c 0a 3e 74 6f 20 |job. OK |OK,.>to |
|000005a0| 73 75 6d 6d 65 72 69 73 | 65 2c 20 74 68 65 20 70 |summeris|e, the p|
|000005b0| 72 6f 62 6c 65 6d 20 69 | 73 20 74 68 61 74 20 49 |roblem i|s that I|
|000005c0| 20 63 61 6e 27 74 20 73 | 65 65 6d 20 74 6f 20 66 | can't s|eem to f|
|000005d0| 69 6e 64 20 61 20 77 61 | 79 20 74 6f 20 64 69 72 |ind a wa|y to dir|
|000005e0| 65 63 74 6c 79 20 64 65 | 6c 65 74 65 0a 3e 61 20 |ectly de|lete.>a |
|000005f0| 64 61 74 61 20 73 65 67 | 6d 65 6e 74 20 66 6f 72 |data seg|ment for|
|00000600| 6d 20 61 20 66 69 6c 65 | 2c 20 77 69 74 68 6f 75 |m a file|, withou|
|00000610| 74 20 72 65 61 64 69 6e | 67 20 69 6e 74 6f 20 6d |t readin|g into m|
|00000620| 65 6d 6f 72 79 20 66 69 | 72 73 74 2e 20 53 6f 20 |emory fi|rst. So |
|00000630| 61 6e 79 20 69 64 65 61 | 73 2c 20 61 6e 64 0a 3e |any idea|s, and.>|
|00000640| 68 65 6c 70 20 77 6f 75 | 6c 64 20 62 65 20 67 72 |help wou|ld be gr|
|00000650| 65 61 74 6c 79 20 61 70 | 70 72 65 63 69 61 74 65 |eatly ap|preciate|
|00000660| 64 2e 20 54 68 61 6e 6b | 73 20 69 6e 20 61 64 76 |d. Thank|s in adv|
|00000670| 61 6e 63 65 20 2e 0a 0a | 4e 6f 20 73 68 6f 72 74 |ance ...|No short|
|00000680| 63 75 74 73 20 68 65 72 | 65 2c 20 62 75 74 20 49 |cuts her|e, but I|
|00000690| 20 77 6f 75 6c 64 20 73 | 75 67 67 65 73 74 20 79 | would s|uggest y|
|000006a0| 6f 75 20 61 6c 6c 6f 63 | 61 74 65 20 61 20 72 65 |ou alloc|ate a re|
|000006b0| 61 73 6f 6e 61 62 6c 65 | 20 73 69 7a 65 20 62 75 |asonable| size bu|
|000006c0| 66 66 65 72 0a 61 6e 64 | 20 75 73 65 20 61 20 6c |ffer.and| use a l|
|000006d0| 6f 6f 70 20 72 65 61 64 | 2f 77 72 69 74 65 20 72 |oop read|/write r|
|000006e0| 61 74 68 65 72 20 74 68 | 61 6e 20 63 6f 70 79 20 |ather th|an copy |
|000006f0| 61 20 70 6f 74 65 6e 74 | 69 61 6c 6c 79 20 68 75 |a potent|ially hu|
|00000700| 67 65 20 66 69 6c 65 20 | 69 6e 74 6f 0a 6d 65 6d |ge file |into.mem|
|00000710| 6f 72 79 2e 20 0a 0a 2d | 42 72 69 61 6e 20 3a 2d |ory. ..-|Brian :-|
|00000720| 29 0a 2d 2d 20 0a 42 72 | 69 61 6e 20 46 2e 20 4c |).-- .Br|ian F. L|
|00000730| 65 61 63 68 0a 53 72 2e | 20 53 79 73 74 65 6d 73 |each.Sr.| Systems|
|00000740| 20 41 6e 61 6c 79 73 74 | 0a 6c 61 73 62 66 6c 40 | Analyst|.lasbfl@|
|00000750| 61 61 69 2e 61 72 63 6f | 2e 63 6f 6d 0a 0a 54 65 |aai.arco|.com..Te|
|00000760| 6c 65 70 68 6f 6e 65 3a | 09 28 39 30 37 29 20 32 |lephone:|.(907) 2|
|00000770| 36 33 2d 34 38 36 30 0a | 46 41 58 3a 09 09 28 39 |63-4860.|FAX:..(9|
|00000780| 30 37 29 20 32 36 35 2d | 36 32 39 38 0a 0a 41 52 |07) 265-|6298..AR|
|00000790| 43 4f 20 41 6c 61 73 6b | 61 2c 20 49 6e 63 2e 0a |CO Alask|a, Inc..|
|000007a0| 41 54 4f 2d 31 36 35 36 | 0a 50 2e 4f 2e 20 42 6f |ATO-1656|.P.O. Bo|
|000007b0| 78 20 31 30 30 33 36 30 | 0a 41 6e 63 68 6f 72 61 |x 100360|.Anchora|
|000007c0| 67 65 2c 20 41 4b 20 39 | 39 35 31 30 2d 30 33 36 |ge, AK 9|9510-036|
|000007d0| 30 0a 0a | |0.. | |
+--------+-------------------------+-------------------------+--------+--------+